import service from '@/utils/request'
// @Tags Order
// @Summary 创建订单管理
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Order true "创建订单管理"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /orders/createOrder [post]
export const createOrder = (data) => {
  return service({
    url: '/orders/createOrder',
    method: 'post',
    data
  })
}

// @Tags Order
// @Summary 删除订单管理
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Order true "删除订单管理"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /orders/deleteOrder [delete]
export const deleteOrder = (params) => {
  return service({
    url: '/orders/deleteOrder',
    method: 'delete',
    params
  })
}

// @Tags Order
// @Summary 批量删除订单管理
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除订单管理"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /orders/deleteOrder [delete]
export const deleteOrderByIds = (params) => {
  return service({
    url: '/orders/deleteOrderByIds',
    method: 'delete',
    params
  })
}

// @Tags Order
// @Summary 更新订单管理
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Order true "更新订单管理"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /orders/updateOrder [put]
export const updateOrder = (data) => {
  return service({
    url: '/orders/updateOrder',
    method: 'put',
    data
  })
}

// @Tags Order
// @Summary 用id查询订单管理
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query model.Order true "用id查询订单管理"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /orders/findOrder [get]
export const findOrder = (params) => {
  return service({
    url: '/orders/findOrder',
    method: 'get',
    params
  })
}

// @Tags Order
// @Summary 分页获取订单管理列表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取订单管理列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /orders/getOrderList [get]
export const getOrderList = (params) => {
  return service({
    url: '/orders/getOrderList',
    method: 'get',
    params
  })
}

// @Tags Order
// @Summary 不需要鉴权的订单管理接口
// @Accept application/json
// @Produce application/json
// @Param data query orderReq.OrderSearch true "分页获取订单管理列表"
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
// @Router /orders/getOrderPublic [get]
export const getOrderPublic = () => {
  return service({
    url: '/orders/getOrderPublic',
    method: 'get',
  })
}
